/**
 * <copyright>
 * </copyright>
 *

 */
package org.xtext.example.cr.cR.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.xtext.example.cr.cR.ArrayElement;
import org.xtext.example.cr.cR.CRPackage;
import org.xtext.example.cr.cR.Element;
import org.xtext.example.cr.cR.Forall;
import org.xtext.example.cr.cR.SimpleVariable;
import org.xtext.example.cr.cR.Size;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Forall</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getFunction <em>Function</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getLocVar <em>Loc Var</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getBegin <em>Begin</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getBeginVar <em>Begin Var</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getBeginFunction <em>Begin Function</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getBeginAE <em>Begin AE</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getEnd <em>End</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getEndVar <em>End Var</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getEndFunction <em>End Function</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getEndAE <em>End AE</em>}</li>
 *   <li>{@link org.xtext.example.cr.cR.impl.ForallImpl#getInnerElements <em>Inner Elements</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ForallImpl extends MinimalEObjectImpl.Container implements Forall
{
  /**
   * The default value of the '{@link #getFunction() <em>Function</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFunction()
   * @generated
   * @ordered
   */
  protected static final String FUNCTION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getFunction() <em>Function</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFunction()
   * @generated
   * @ordered
   */
  protected String function = FUNCTION_EDEFAULT;

  /**
   * The cached value of the '{@link #getLocVar() <em>Loc Var</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getLocVar()
   * @generated
   * @ordered
   */
  protected SimpleVariable locVar;

  /**
   * The default value of the '{@link #getBegin() <em>Begin</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBegin()
   * @generated
   * @ordered
   */
  protected static final int BEGIN_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getBegin() <em>Begin</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBegin()
   * @generated
   * @ordered
   */
  protected int begin = BEGIN_EDEFAULT;

  /**
   * The cached value of the '{@link #getBeginVar() <em>Begin Var</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBeginVar()
   * @generated
   * @ordered
   */
  protected SimpleVariable beginVar;

  /**
   * The cached value of the '{@link #getBeginFunction() <em>Begin Function</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBeginFunction()
   * @generated
   * @ordered
   */
  protected Size beginFunction;

  /**
   * The cached value of the '{@link #getBeginAE() <em>Begin AE</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getBeginAE()
   * @generated
   * @ordered
   */
  protected ArrayElement beginAE;

  /**
   * The default value of the '{@link #getEnd() <em>End</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEnd()
   * @generated
   * @ordered
   */
  protected static final int END_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getEnd() <em>End</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEnd()
   * @generated
   * @ordered
   */
  protected int end = END_EDEFAULT;

  /**
   * The cached value of the '{@link #getEndVar() <em>End Var</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEndVar()
   * @generated
   * @ordered
   */
  protected SimpleVariable endVar;

  /**
   * The cached value of the '{@link #getEndFunction() <em>End Function</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEndFunction()
   * @generated
   * @ordered
   */
  protected Size endFunction;

  /**
   * The cached value of the '{@link #getEndAE() <em>End AE</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getEndAE()
   * @generated
   * @ordered
   */
  protected ArrayElement endAE;

  /**
   * The cached value of the '{@link #getInnerElements() <em>Inner Elements</em>}' containment reference list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getInnerElements()
   * @generated
   * @ordered
   */
  protected EList<Element> innerElements;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ForallImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return CRPackage.Literals.FORALL;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getFunction()
  {
    return function;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFunction(String newFunction)
  {
    String oldFunction = function;
    function = newFunction;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__FUNCTION, oldFunction, function));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable getLocVar()
  {
    if (locVar != null && locVar.eIsProxy())
    {
      InternalEObject oldLocVar = (InternalEObject)locVar;
      locVar = (SimpleVariable)eResolveProxy(oldLocVar);
      if (locVar != oldLocVar)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, CRPackage.FORALL__LOC_VAR, oldLocVar, locVar));
      }
    }
    return locVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable basicGetLocVar()
  {
    return locVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setLocVar(SimpleVariable newLocVar)
  {
    SimpleVariable oldLocVar = locVar;
    locVar = newLocVar;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__LOC_VAR, oldLocVar, locVar));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getBegin()
  {
    return begin;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setBegin(int newBegin)
  {
    int oldBegin = begin;
    begin = newBegin;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__BEGIN, oldBegin, begin));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable getBeginVar()
  {
    if (beginVar != null && beginVar.eIsProxy())
    {
      InternalEObject oldBeginVar = (InternalEObject)beginVar;
      beginVar = (SimpleVariable)eResolveProxy(oldBeginVar);
      if (beginVar != oldBeginVar)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, CRPackage.FORALL__BEGIN_VAR, oldBeginVar, beginVar));
      }
    }
    return beginVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable basicGetBeginVar()
  {
    return beginVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setBeginVar(SimpleVariable newBeginVar)
  {
    SimpleVariable oldBeginVar = beginVar;
    beginVar = newBeginVar;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__BEGIN_VAR, oldBeginVar, beginVar));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Size getBeginFunction()
  {
    return beginFunction;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetBeginFunction(Size newBeginFunction, NotificationChain msgs)
  {
    Size oldBeginFunction = beginFunction;
    beginFunction = newBeginFunction;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__BEGIN_FUNCTION, oldBeginFunction, newBeginFunction);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setBeginFunction(Size newBeginFunction)
  {
    if (newBeginFunction != beginFunction)
    {
      NotificationChain msgs = null;
      if (beginFunction != null)
        msgs = ((InternalEObject)beginFunction).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FORALL__BEGIN_FUNCTION, null, msgs);
      if (newBeginFunction != null)
        msgs = ((InternalEObject)newBeginFunction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FORALL__BEGIN_FUNCTION, null, msgs);
      msgs = basicSetBeginFunction(newBeginFunction, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__BEGIN_FUNCTION, newBeginFunction, newBeginFunction));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ArrayElement getBeginAE()
  {
    return beginAE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetBeginAE(ArrayElement newBeginAE, NotificationChain msgs)
  {
    ArrayElement oldBeginAE = beginAE;
    beginAE = newBeginAE;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__BEGIN_AE, oldBeginAE, newBeginAE);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setBeginAE(ArrayElement newBeginAE)
  {
    if (newBeginAE != beginAE)
    {
      NotificationChain msgs = null;
      if (beginAE != null)
        msgs = ((InternalEObject)beginAE).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FORALL__BEGIN_AE, null, msgs);
      if (newBeginAE != null)
        msgs = ((InternalEObject)newBeginAE).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FORALL__BEGIN_AE, null, msgs);
      msgs = basicSetBeginAE(newBeginAE, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__BEGIN_AE, newBeginAE, newBeginAE));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getEnd()
  {
    return end;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setEnd(int newEnd)
  {
    int oldEnd = end;
    end = newEnd;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__END, oldEnd, end));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable getEndVar()
  {
    if (endVar != null && endVar.eIsProxy())
    {
      InternalEObject oldEndVar = (InternalEObject)endVar;
      endVar = (SimpleVariable)eResolveProxy(oldEndVar);
      if (endVar != oldEndVar)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, CRPackage.FORALL__END_VAR, oldEndVar, endVar));
      }
    }
    return endVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public SimpleVariable basicGetEndVar()
  {
    return endVar;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setEndVar(SimpleVariable newEndVar)
  {
    SimpleVariable oldEndVar = endVar;
    endVar = newEndVar;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__END_VAR, oldEndVar, endVar));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Size getEndFunction()
  {
    return endFunction;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetEndFunction(Size newEndFunction, NotificationChain msgs)
  {
    Size oldEndFunction = endFunction;
    endFunction = newEndFunction;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__END_FUNCTION, oldEndFunction, newEndFunction);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setEndFunction(Size newEndFunction)
  {
    if (newEndFunction != endFunction)
    {
      NotificationChain msgs = null;
      if (endFunction != null)
        msgs = ((InternalEObject)endFunction).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FORALL__END_FUNCTION, null, msgs);
      if (newEndFunction != null)
        msgs = ((InternalEObject)newEndFunction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FORALL__END_FUNCTION, null, msgs);
      msgs = basicSetEndFunction(newEndFunction, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__END_FUNCTION, newEndFunction, newEndFunction));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ArrayElement getEndAE()
  {
    return endAE;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetEndAE(ArrayElement newEndAE, NotificationChain msgs)
  {
    ArrayElement oldEndAE = endAE;
    endAE = newEndAE;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__END_AE, oldEndAE, newEndAE);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setEndAE(ArrayElement newEndAE)
  {
    if (newEndAE != endAE)
    {
      NotificationChain msgs = null;
      if (endAE != null)
        msgs = ((InternalEObject)endAE).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CRPackage.FORALL__END_AE, null, msgs);
      if (newEndAE != null)
        msgs = ((InternalEObject)newEndAE).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CRPackage.FORALL__END_AE, null, msgs);
      msgs = basicSetEndAE(newEndAE, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, CRPackage.FORALL__END_AE, newEndAE, newEndAE));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<Element> getInnerElements()
  {
    if (innerElements == null)
    {
      innerElements = new EObjectContainmentEList<Element>(Element.class, this, CRPackage.FORALL__INNER_ELEMENTS);
    }
    return innerElements;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case CRPackage.FORALL__BEGIN_FUNCTION:
        return basicSetBeginFunction(null, msgs);
      case CRPackage.FORALL__BEGIN_AE:
        return basicSetBeginAE(null, msgs);
      case CRPackage.FORALL__END_FUNCTION:
        return basicSetEndFunction(null, msgs);
      case CRPackage.FORALL__END_AE:
        return basicSetEndAE(null, msgs);
      case CRPackage.FORALL__INNER_ELEMENTS:
        return ((InternalEList<?>)getInnerElements()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case CRPackage.FORALL__FUNCTION:
        return getFunction();
      case CRPackage.FORALL__LOC_VAR:
        if (resolve) return getLocVar();
        return basicGetLocVar();
      case CRPackage.FORALL__BEGIN:
        return getBegin();
      case CRPackage.FORALL__BEGIN_VAR:
        if (resolve) return getBeginVar();
        return basicGetBeginVar();
      case CRPackage.FORALL__BEGIN_FUNCTION:
        return getBeginFunction();
      case CRPackage.FORALL__BEGIN_AE:
        return getBeginAE();
      case CRPackage.FORALL__END:
        return getEnd();
      case CRPackage.FORALL__END_VAR:
        if (resolve) return getEndVar();
        return basicGetEndVar();
      case CRPackage.FORALL__END_FUNCTION:
        return getEndFunction();
      case CRPackage.FORALL__END_AE:
        return getEndAE();
      case CRPackage.FORALL__INNER_ELEMENTS:
        return getInnerElements();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case CRPackage.FORALL__FUNCTION:
        setFunction((String)newValue);
        return;
      case CRPackage.FORALL__LOC_VAR:
        setLocVar((SimpleVariable)newValue);
        return;
      case CRPackage.FORALL__BEGIN:
        setBegin((Integer)newValue);
        return;
      case CRPackage.FORALL__BEGIN_VAR:
        setBeginVar((SimpleVariable)newValue);
        return;
      case CRPackage.FORALL__BEGIN_FUNCTION:
        setBeginFunction((Size)newValue);
        return;
      case CRPackage.FORALL__BEGIN_AE:
        setBeginAE((ArrayElement)newValue);
        return;
      case CRPackage.FORALL__END:
        setEnd((Integer)newValue);
        return;
      case CRPackage.FORALL__END_VAR:
        setEndVar((SimpleVariable)newValue);
        return;
      case CRPackage.FORALL__END_FUNCTION:
        setEndFunction((Size)newValue);
        return;
      case CRPackage.FORALL__END_AE:
        setEndAE((ArrayElement)newValue);
        return;
      case CRPackage.FORALL__INNER_ELEMENTS:
        getInnerElements().clear();
        getInnerElements().addAll((Collection<? extends Element>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case CRPackage.FORALL__FUNCTION:
        setFunction(FUNCTION_EDEFAULT);
        return;
      case CRPackage.FORALL__LOC_VAR:
        setLocVar((SimpleVariable)null);
        return;
      case CRPackage.FORALL__BEGIN:
        setBegin(BEGIN_EDEFAULT);
        return;
      case CRPackage.FORALL__BEGIN_VAR:
        setBeginVar((SimpleVariable)null);
        return;
      case CRPackage.FORALL__BEGIN_FUNCTION:
        setBeginFunction((Size)null);
        return;
      case CRPackage.FORALL__BEGIN_AE:
        setBeginAE((ArrayElement)null);
        return;
      case CRPackage.FORALL__END:
        setEnd(END_EDEFAULT);
        return;
      case CRPackage.FORALL__END_VAR:
        setEndVar((SimpleVariable)null);
        return;
      case CRPackage.FORALL__END_FUNCTION:
        setEndFunction((Size)null);
        return;
      case CRPackage.FORALL__END_AE:
        setEndAE((ArrayElement)null);
        return;
      case CRPackage.FORALL__INNER_ELEMENTS:
        getInnerElements().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case CRPackage.FORALL__FUNCTION:
        return FUNCTION_EDEFAULT == null ? function != null : !FUNCTION_EDEFAULT.equals(function);
      case CRPackage.FORALL__LOC_VAR:
        return locVar != null;
      case CRPackage.FORALL__BEGIN:
        return begin != BEGIN_EDEFAULT;
      case CRPackage.FORALL__BEGIN_VAR:
        return beginVar != null;
      case CRPackage.FORALL__BEGIN_FUNCTION:
        return beginFunction != null;
      case CRPackage.FORALL__BEGIN_AE:
        return beginAE != null;
      case CRPackage.FORALL__END:
        return end != END_EDEFAULT;
      case CRPackage.FORALL__END_VAR:
        return endVar != null;
      case CRPackage.FORALL__END_FUNCTION:
        return endFunction != null;
      case CRPackage.FORALL__END_AE:
        return endAE != null;
      case CRPackage.FORALL__INNER_ELEMENTS:
        return innerElements != null && !innerElements.isEmpty();
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (function: ");
    result.append(function);
    result.append(", begin: ");
    result.append(begin);
    result.append(", end: ");
    result.append(end);
    result.append(')');
    return result.toString();
  }

} //ForallImpl
